<template>
    <div>
        <ul>
            <li v-for="(item, index) in goodsList" :key="index" @click="toPruductDetail(item.id)">
                <img v-lazy="item.list_pic_url" style="display:block;" width="100%" alt="" />
                <div class="van-ellipsis">{{item.name}}</div>
                <div class="price">{{item.retail_price | RMBformat}}</div>
            </li>
        </ul>
        <van-empty description="没有更多商品数据了" v-show="goodsList.length==0"/>
    </div>
    
</template>

<script>
export default {
    props:['goodsList'],
    data () {
        return {
        
        }
    },
    methods:{
        toPruductDetail(id){
            this.$router.push('/PruductDetail?id='+id)
        }
    }
}
</script>

<style lang = "less" scoped>
ul{
    padding: .1rem 2%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    li{
        width: 49%;
        margin-bottom: .1rem;
        background: #fff;
        text-align: center;
        line-height: .3rem;
        .price{
            color: darkred;
        }
    }
}
</style>